/**************************
This function save all the histograms to a file.


*****************************/

using namespace std;

void print_histo(ofstream *outhisto, gsl_histogram * histo){
  

  //write
  long buffl=0;
  double buffd=0;
  
  //size
  buffl=histo->n;
  outhisto->write((char *)(&buffl),sizeof(buffl));

  //write range
  for(int i=0;i<=(int)histo->n;i++){
    buffd=histo->range[i];
    outhisto->write((char *)(&buffd),sizeof(buffd));
  }


  //write bin

  
  for(int i=0;i<(int)histo->n;i++){
    buffd=gsl_histogram_get(histo,i);
    outhisto->write((char *)(&buffd),sizeof(buffd));
  }

  
  return;
}
